import request from '/@/utils/request';

/**
 * 客户管理相关接口
 */

// 分页查询
export function getCustomerPage(params) {
	return request({
		url: '/platform/customer/page',
		method: 'get',
		params,
	});
}

// 通过条件查询
export function getCustomerList(params) {
	return request({
		url: '/platform/customer/details',
		method: 'get',
		params,
	});
}

// 新增客户信息
export function addCustomer(data) {
	return request({
		url: '/platform/customer/addCustomer',
		method: 'post',
		data,
	});
}

// 修改客户信息
export function updateCustomer(data) {
	return request({
		url: '/platform/customer/updateById',
		method: 'put',
		data,
	});
}

// 通过id启用/禁用客户信息
export function toggleCustomerStatus(data) {
	return request({
		url: `/platform/customer/forbidById`,
		method: 'put',
		data,
	});
}

// 通过id删除客户信息
export function deleteCustomer(id) {
	return request({
		url: `/platform/customer/delById/${id}`,
		method: 'delete',
	});
}
